<% onchange = %(update_hash_attribute_raw_value(this)) %>
<tr>
  <td>
    <div class="input-append">
      <% if fixed_keys %>
        <%= hidden_field_tag("#{attribute_name}_key", key, :class => 'hash_key') %>
        <span class="add-on hash_key">
          <% desc = fixed_keys.is_a?(Hash) && fixed_keys[key] %>
          <% if desc.blank? %>
            <b><%= key %></b>
          <% else %>
            <%= link_to(key, '#', :rel => 'tooltip', :title => desc) %>
          <% end %>
        </span>
        <span class="add-on"><b>=</b></span>
      <% else %>
        <%= text_field_tag("#{attribute_name}_key", key,
                           :onchange    => onchange,
                           :class       => fixed_keys ? 'hash_key readonly' : 'hash_key',
                           :placeholder => placeholders[:key]) %>
        <span class="add-on"><b>=</b></span>
      <% end %>
    </div>
  </td>
  <td>
    <div class="input-append" style="margin-left: -3px">
      <% field_opts = {:class    => 'hash_value',
                       :onchange => onchange} %>
      <% if pattern.is_a?(Array) %>
        <% pattern += [value] if value.present? && pattern.none? { |e| value == (e.is_a?(Array) ? e.last : e) } %>
        <%= select_tag("#{attribute_name}_value",
                       raw(%(<option disabled="disabled" value>#{placeholders[:value]}</option>#{options_for_select(pattern, value)})),
                       field_opts) %>
      <% else %>
        <%= text_field_tag("#{attribute_name}_value",
                           value,
                           field_opts.merge(:pattern     => pattern,
                                            :placeholder => placeholders[:value])) %>
      <% end %>

      <%= link_to_function raw("<span class='add-on'>#{icon('times')}</div>"), %(delete_hash_attribute_row(this)) if allow_delete && !fixed_keys %>
    </div>
  </td>
</tr>
